//
//  DeviceMessageViewCell.m
//  TaiHao
//
//  Created by rzm on 16/6/2.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "DeviceMessageViewCell.h"

@implementation DeviceMessageViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self layoutIfNeeded];
    CGFloat font = 8.;
    if (IS_IPHONE_4_OR_LESS) {
        font = 12.;
    }else if (IS_IPHONE_5_OR_LESS)
    {
        font = 14.;
    }else if (IS_IPHONE_6)
    {
        font = 14;
    }else
    {
        font = 14;
    }
    
    [self layoutIfNeeded];
    _nameLab.textColor = THWhiteAlplaColor(0.8);
    self.nameLab.font = THFont(font);
    self.deviceLab.font = THFont(font - 2);
    _deviceLab.textColor = THWhiteAlplaColor(0.8);

    
    _lineView = [[UIView alloc]init];
    [self addSubview:_lineView];
    _lineView.backgroundColor = THWhiteAlplaColor(0.8);
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setDeviceStr:(NSString *)deviceStr
{
    _deviceStr = deviceStr;
    _deviceLab.text = _deviceStr;
    [self layoutIfNeeded];
    _lineView.frame = CGRectMake(_deviceLab.x, _deviceLab.bottom, _deviceLab.width, 1);

}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _lineView.frame = CGRectMake(_deviceLab.x, _deviceLab.bottom, _deviceLab.width, 1);

}
@end
